import request from "./../utils/request.js";
/**
 * 订单确认获取订单详细信息
 * @param string cartId
*/
export function orderConfirm(cartId) {
  return request.post('store/confirm', { cartList: cartId });
}
/**
 * 计算订单金额
 * @param key
 * @param data
 * @returns {*}
 */
export function postOrderComputed(data) {
  return request.post("store/compute", data);
}

/**
 * 订单创建
 * @param string key
 * @param object data
 * 
*/
export function orderCreate(data) {
  return request.post('store/create', data);
}
/**
 * 查询订单支付状态信息
 */
export function queryPayStatus(orderId) {
  return request.get('store/paystatus/' + orderId);
}

/**
 * 查询用户的订单统计信息
 */
export function queryOrderStat() {
  return request.post('store/orderStat');
}

/**
* 订单列表
* @param object data
*/
export function getOrderList(data) {
  return request.post('store/list', data);
}
/**
 * 订单详情
 * @param string uni 
*/
export function getOrderDetail(orderId) {
  return request.get('store/detail/' + orderId);
}

/**
 * 订单取消
 * 
*/
export function orderCancel(orderId) {
  return request.post('store/cancel', { orderId: orderId });
}

/**
 * 订单收获-代理人代收
 * 
*/
export function orderCheck(orderId) {
  return request.post('store/check', { orderId: orderId });
}

/**
 * 订单申请退款
 * 
*/
export function orderRefund(orderId) {
  return request.post('store/refund', { orderId: orderId });
}

/**
 * 订单完成
 * 
*/
export function orderComplete(orderId) {
  return request.post('store/complete', { orderId: orderId });
}


/**
 * 订单删除
 * 
*/
export function orderDelete(orderId) {
  return request.post('store/delete', { orderId: orderId });
}
/**
 * 订单支付
 * 
*/
export function orderPay(data) {
  return request.post('store/payment', data);
}
